﻿package
{
	import flash.display.MovieClip;
	
	import ms.utils.ButtonManager;
	import ms.events.ButtonEvent;
	
	import gs.TweenMax;
	
	public class Explorer extends MovieClip
	{
		public function Explorer()
		{
			this.addEventListener(ButtonEvent.CLICK, open_handler);
			this.addEventListener(ButtonEvent.CLOSE, close_handler);
		}
		
		private function close_handler(e:ButtonEvent):void
		{
			ButtonManager.restore();
			TweenMax.to(hover, .5, {alpha:1, rotation:0, removeTint:true, scaleX:1, scaleY:1});
			trace(e.target.name);
		}
		
		private function open_handler(e:ButtonEvent):void
		{
			ButtonManager.disable();
			TweenMax.to(hover, .5, {alpha:hover.alpha-0.15, rotation:hover.rotation+45, tint:0x6699ff, scaleX:0.7, scaleY:0.7});
			trace(e.target.name);
		}
	}
}